// 物流公司
import http, {
	getEnv
} from '@/common/request.js'

// 登录
export const login = (data) => {
	return http("/v1/car/reporter/login", data)
}

// 注册
export const register = (data) => {
	data.tenantId = getEnv()['TENANTID']
	return http("/v1/car/reporter/register", data)
}

// 根据登录获取的token 获取用户信息
export const getInfo = () => {
	return http("/v1/sys/auth/getInfo", {}, true, {
		method: 'get'
	})
}

// 根据用户信息中的id 查询包车人详情
export const getUserDetails = (id) => {
	return http("/v1/car/reporter/get", {
		id
	}, true, {
		method: 'get'
	})
}

// 用车需求
export const getList = (data) => {
	return http("/v1/ls/vehicle/need/app/getList", data, true, {
		method: 'get'
	})
}

// 我的用车需求
export const myNeedList = (data) => {
	return http("/v1/ls/vehicle/need/app/getMyNeedList", data, true, {
		method: 'get'
	})
}

// 查询用车详情
export const needDetails = (id) => {
	return http("/v1/ls/vehicle/need/get", {
		id
	}, true, {
		method: 'get'
	})
}

// 添加用车信息
export const saveCar = (data) => {
	return http("/v1/ls/vehicle/need/info/app/save", data)
}

// 查询填报的车辆信息
export const getReportCar = (data) => {
	return http("/v1/ls/vehicle/need/info/app/getList", data, true, {
		method: 'get'
	})
}

// 查新填报车辆信息详情 【审批过的】
export const getReportCarInfo = (id) => {
	return http("/v1/ls/vehicle/need/info/get", {
		id
	}, true, {
		method: 'get'
	})
}

// 修改密码
export const updatePassWord = (data) => {
	return http("/v1/car/reporter/updPass", data)
}

// 查询用填报过的车辆信息
export const getReportCarList = (needId) => {
	return http("/v1/ls/vehicle/need/info/app/getList", {
		needId
	}, false, {
		method: 'get'
	})
}

// 根据车号查询车辆信息
export const getDriverToNo = (vehicleNo) => {
	return http("/v1/ls/vehicle/info/getVehicleNo", {
		vehicleNo
	}, false, {
		method: 'get'
	})
}

// 识别字段中的数据
export const getStringDataToObject = (msg) => {
	return http('/chat', {
		content: `请根据我给出的一句话，帮我总结出json数组格式的数据，要求包含姓名，身份证号，手机号，车号，挂车号信息。信息如下：${msg}`
	})
}

// 我填写过的用车需求带车辆
export const getUseByCarList = (data) => {
	return http("/v1/ls/vehicle/need/info/app/getList", data, false, {
		method: 'get'
	})
}

// 报废车辆信息
export const discardCar = (data) => {
	return http("/v1/ls/vehicle/need/info/app/discardNeedInfo", data, false, {
		method: 'get'
	})
}

// 换车换司机（修改车辆信息）
export const editCar = (data) => {
	return http("/v1/ls/vehicle/need/info/app/edit", data)
}

// 确认变更通知
export const confirmNotify = (data) => {
	return http("/v1/sys/data/change/msg/app/confirm", data, false, {
		method: 'get'
	})
}

// 更新司机账户榜单
export const updateBd = (data) => {
	return http("/v1/ls/vehicle/need/info/app/edit/confirm", data)
}